import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [{
      path: '/',
      name: 'list',
      component: () => import('../views/List.vue')
    },
    {
      path: '/list',
      name: 'list',
      component: () => import('../views/List.vue')
    },
    {
      path: '/product',
      name: 'product',
      component: () => import('../views/product.vue')
    },
    
    {
      path: '/cart',
      name: 'cart',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/cart.vue')
    },
    {
      path:'/:a*',
      //redirect(name,'home)
      redirect:'/list'

    }
  ]
})

export default router
